<?php
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2023 https://www.gxgyl.com All rights reserved.

// +----------------------------------------------------------------------
// | Author: Liuyu
// +----------------------------------------------------------------------
declare (strict_types = 1);

namespace app\api\model\shiyao;

use app\api\model\User as UserModel;
use app\api\service\User as UserService;
use app\common\model\shiyao\Company as CompanyModel;
use cores\exception\BaseException;

/**
 * 模型
 * Class
 * @package app\common\model
 */
class Company extends CompanyModel {
	/**
	 * 隐藏字段
	 * @var array
	 */
	protected $hidden = [
		'is_delete',
		'store_id',
		'create_time',
		'update_time',
	];

	/**
	 * 获取收货地址列表
	 * @return \think\Collection
	 * @throws \think\db\exception\DataNotFoundException
	 * @throws \think\db\exception\DbException
	 * @throws \think\db\exception\ModelNotFoundException
	 * @throws BaseException
	 */
	public function getList() {
		$userId = UserService::getCurrentLoginUserId();
		return $this->where('pm_id', '=', $userId)
			->where('is_delete', '=', 0)
			->paginate(15);
	}


}
